<?php
/* -------------------------------------------------------------------------
 * Nom du fichier : content.php
 * -------------------------------------------------------------------------
 */
    
// Définition du fuseau horaire
date_default_timezone_set("Europe/Paris");
    
// Session Start
if(!isset($_SESSION)) session_start();

// Include
include_once(SITE_ROOT .'/inc/class_db.php');
    
//Ouvre la connexion à la base de donnée
$db = New Database;
    
$sql = "SELECT * FROM flux ORDER by date DESC";
$db->array_query($sql);
    
while( $msg = $db->retourArray() ) {
    $sql2 = "SELECT * FROM users WHERE id = ".$msg['from']."";
    $db->select_query($sql2);
    $senduser = $db->retourLigne();
    $msgcont = htmlspecialchars($msg['msg'],ENT_QUOTES);
    $msgcont = smyle($msgcont);
    ?>
    <div class="msg">
        <img src="<?=$senduser['img']?>" alt="<?=$senduser['nom']?>" width="50" height="50"/>
        <h4><?=$senduser['nom']?></h4>
        <p class="date_p"><?=$msg['date']?></p>
        <p class="bulle"><?=$msgcont?></p>
        <?
        if (!empty($msg['lienvideo'])) {
            if ($_SESSION['mobile'] !== 'mobile') {
            ?>
    	    <iframe width="560" height="315" src="<?=$msg['lienvideo']?>" frameborder="0" allowfullscreen></iframe>
            <?
			}
        }
        ?>
    </div>
    <?
}
	
?>
		
